<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>php make page list</title>
</head>
<body>
<table width="860">
    <tr>
        <td width="180" align="center" height="80"  bgcolor="#E0EEE0">题目</td>
        <td width="670" align="center"  bgcolor="#E0EEE0">内容</td>
    </tr>
<?php
$conn = mysqli_connect("localhost","root","","abcd");
if (!$conn){
    die("连接数据库失败：" . mysqli_error());
}
header("Content-type:text/html;charset=utf-8");
$numq=mysqli_query($conn,"SELECT * FROM `message`");
$num = mysqli_num_rows($numq);
$num=$num-6;
$sql=mysqli_query($conn,"select * from message limit $num,6");
while ($row=@mysqli_fetch_array($sql)) {
    ?>
        <tr>
            <td bgcolor="#E0EEE0" height="80"><div align="center">
                    <?php echo $row['title']?>
                </div></td>
            <td bgcolor="#E0EEE"><div align="center">
                    <?php echo $row['content']?>
                </div></td>
        </tr>
    <?php
}?>
</table>
</body>
</html>





